It is sometimes useful in database query optimization to share intermediate results. An intermediate result is produced in the process of performing a database operation, such as a request or a query. For example, a SQL query might cause a number of rows to be read from a database table and temporarily stored in a spool file. The spool file is an example of an intermediate result. Such an intermediate result might be used in later processing of the query to produce another intermediate result or to produce the final result of the query. It is sometimes useful in optimizing the execution of a query to share intermediate results with various parts of the processing of the query. Due to the architecture of SQL engines, optimizations such as these are typically limited to the context of a single request submitted by a client. Likewise, the lifetime of internally generated spool files is typically limited to a single request.